#ifndef DBCOLUMNSMODEL_H
#define DBCOLUMNSMODEL_H

#include <QAbstractTableModel>

class AbstractContainer;

class DbColumnsModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit DbColumnsModel(QObject *parent = 0);
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    bool setData(const QModelIndex &index, const QVariant &value, int role);

    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
    Qt::ItemFlags flags ( const QModelIndex & index ) const;

    bool insertRow(int row, const QModelIndex &parent = QModelIndex());
    bool removeRow(int row, const QModelIndex &parent = QModelIndex());

    void setColumnsList(AbstractContainer *tables);

private:
    AbstractContainer *m_columns;
    QList<QString> m_columnsName;
};

#endif // DBCOLUMNSMODEL_H
